JBoss Community Archive (Read Only)

Scribble

Global Escape

The 'global escape' concept provides a means for breaking out of a particular
scope based on an interaction.

The syntax for the global escape construct is:

do "{"
	...
( "}" interrupt "{"
	...
)+
"}"

In the following example, the body of the do block is enacted,
involving an interaction between a Buyer and Seller,
followed by some other activities.

During this scoped set of activities, if the Seller returns an
OutOfStock message, then it will cause the flow of control to
move to the first interrupt block. However if the Buyer sends an
OrderExpired or OrderCancelled message,
then the flow will move to the second interrupt block.

do {
    Order from Buyer to Seller;
    ...
} interrupt {
    OutOfStock from Seller to Buyer;
	...
} interrupt {
    choice at Buyer {
        expire(OrderExpired) from Buyer to Seller;
    } or {
        OrderCancelled from Buyer to Seller);
    }
    ...
}
JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-13 09:37:58 UTC, last content change 2011-11-13 16:03:09 UTC.